package solutions.ferpa.ztest.intf;

import br.com.telescope.adsrt.lib.*;
import br.com.telescope.t2.*;
import br.com.telescope.t2.AccessPolicy;
import br.com.telescope.t2.ServiceModel;
import br.com.telescope.t2.exception.ApplicationRuntimeException;
import br.com.telescope.t2.feature.CustomActionFeature;
import java.util.List;
import solutions.ferpa.ztest.ent.*;

/**
 * Install.
 * <p>
 * Interface que executa todas as operações desejadas no processo de 
 * instalação.
 * <P>
 * 
 * <P>
 * Telescope origin: RTSYSINF.INSTALL
 * <P>
 * @author TELESCOPE - Build task T2 Web Interface Generator
 * <P>
 * @version 0.1
 */
public class Install extends ServiceModel {
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    public static final String GLOBAL_NAME = "RTSYSINF.INSTALL";
    
    @Override
    public String globalName() {
        return GLOBAL_NAME;
    }
    
    {
        setTitle("Install");
    }
    
    
    // Record items
    
    // Query items
    
    @Override
    public void initAttributes() {
        
    }
    
    @Override
    public String getDefaultOrderBy() {
        return "";
    }
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="INSTALL">
    public class FInstall extends CustomActionFeature {
        
        @Override
        public void initForm() {
        }
        
        @Override
        public int getAccessPolicy() {
            return AccessPolicy.USER;
        }
        
        @Override
        public void execute() {
            try {
                install();
            } catch (AdsException ex) {
                throw new ApplicationRuntimeException(ex);
            }
        }
        
        {
            setFeatureName("INSTALL");
            setPrimary(false);
        }
    }
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="initFeatures">
    
    @Override
    protected void initFeatures() {
        addFeature(new FInstall());
        super.initFeatures();
    }
    
    @Override
    public String getDefaultFeature() {
        return "INSTALL";
    }
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="Getters and Setters">
    // </editor-fold>
    
    /**
     * null.
     */
    public void install() throws AdsException {
        // <user-code id="2304819" parentId="2304757" hashcode="7e6c92a2" length="251">
        // import br.com.telescope.t2.*;
        ApplicationInfo appinfo = ApplicationInfo.getInstance();
        List<EntityBean> ents = appinfo.getEntities();
        for (EntityBean eb : ents) {
            /*Entity e = eb.newInstance();
            e.setContext(ctx);
            e.install();*/
        }
        // </user-code>
    }
}
